package cn.janus;

import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.nio.file.Paths;
import java.time.LocalDate;

public class CodeGenerator {
    public static void main(String[] args) {
        com.baomidou.mybatisplus.generator.FastAutoGenerator.create("jdbc:mysql://47.96.236.147:3306/tally",
                        "jose", "jose")//数据库配置
                .globalConfig(builder -> builder
                        .author("janus")//作者
                        .outputDir("C:\\Users\\luwei\\IdeaProjects\\flimheaven\\tally\\src\\main\\java")//生成代码地址
                        .commentDate(String.valueOf(LocalDate.now()))//日期
                )
                .packageConfig(builder -> builder
                        .parent("cn.janus")//上级目录
                        .entity("entity")
                        .mapper("mapper")
                        .service("service")
                        .serviceImpl("service.impl")
                        .xml("mapper.xml")
                )
                .strategyConfig(builder -> builder
                        .addInclude("bill")
                        .entityBuilder()
                        .enableLombok()
                )
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();
    }

}
